<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="com.bci.pwtz.common.util.SpringUtil" %>
<%@ page import="com.bci.pwtz.service.CompanyRoleService" %>
<%@ page import="com.bci.pwtz.common.ActionCodeConstants" %>
<%
	int roleid = Integer.parseInt(request.getParameter("roleid"));
	CompanyRoleService companyRoleService = (CompanyRoleService)SpringUtil.getBean("companyRoleService");
	boolean canEditRole = false;
	CompanyUser company_user = (CompanyUser) session.getAttribute("user");
	if(company_user!=null) {
	    long currentLastCompanyId = company_user.getLastCompanyId();
	    if(!companyRoleService.checkExistsCompanyRole(currentLastCompanyId, roleid))
	    {
	        response.sendRedirect("rolelist.jsp");
	    }
	    canEditRole = companyRoleService.checkHasAction(request,ActionCodeConstants.COMPANY_USER_ROLE_EDIT);
	}
%>
<%@ include file="/user/common.jsp"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>配网数据助手-成员管理</title>
<link href="<%=basePath %>user/css/style.css" rel="stylesheet" type="text/css" />
<link href="<%=basePath %>user/css/llcss.css" rel="stylesheet" type="text/css"/>

<script type="text/javascript" src="<%=basePath %>js/jquery/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="<%=basePath %>user/js/hd_ll.js"></script>
<script type="text/javascript" src="<%=basePath %>user/js/common.js"></script>
<script type="text/javascript" src="<%=basePath %>user/m/js/membermanagement.js"></script>
<style type="">
.but {
	display: block;
	background: url(../images/login_btn.png) no-repeat;
	width: 200px;
	height: 50px;
	line-height: 50px;
	font-size: 20px;
	color: #ffffff;
	text-align: center;
}
</style>
<script type="text/javascript" >
var rid='<%=roleid%>';
var canadd=<%=canEditRole%>;
</script>
</head>
<body bgcolor="white">
<div class="all_cover"></div>
<!-- 添加成员列表框_begin -->
<div class="add_members_box">
	<div class="add_members_box_title">
		用户选择
		<img src="../images/add_members_close.jpg" alt="" class="close" onclick="javascrpit:colseuser();"/>
	</div>
	<!-- 关键字搜索_begin -->
	<div class="search_box">
		<input id="loginname" name="loginname" class="search_text" type="text" placeholder="请输入关键字搜索" maxlength="50"/>
		<input class="submit" type="submit" value="搜索" onclick="javascrpit:queryuser();"/>
	</div>	
	<!-- 关键字搜索_end -->
	<!-- 添加成员列表内容_begin -->
	<div class="add_members_cont_box">
		<div class="add_members_cont_title">
			<ul class="add_members_cont_title_ul">
				<li class="number">序号</li>
				<li class="username">用户名</li>
				<li class="tel_num">手机号码</li>
				<li class="checked">选择</li>
			</ul>
		</div>
		<!-- 成员列表_begin -->
		<div id="user">
		</div>
		<!-- 成员列表_end -->
	</div>
	<!-- 添加成员列表内容_end -->
	<!-- 分页_begin -->
		<div class="page" id="userpage">
        </div>
    <!-- 分页_end -->
    <div class="complete_box_submit"><input class="complete_submit" type="submit" value="添 加" onclick="javascrpit:useradd(<%=roleid %>);"/></div>
</div>
<!-- 添加成员列表框_end -->
	<%@ include file="/user/head.jsp"%>
	<div class="pwsj_cont_box">
		<%@ include file="/user/left.jsp"%>
		<div class="pwsj_cont_right_box">
		<%if(companyUser!=null) {%>
			<!-- 成员管理_begin -->
			<div class="members_manage">
				<div class="position" style="margin-bottom:3px">
					<a href="rolelist.jsp">权限管理</a>&gt<a href="membermanagement.jsp?roleid=<%=roleid%>" class="last">成员管理</a>
				</div>
				<%if(canEditRole||isSuper){ %>
				<div class="add_member" onclick="javascrpit:openuser();">添加成员</div><!-- 添加成员按钮 -->
				<%} %>
				<div class="pwsj_right_tjcy_cont_title">
					<ul class="tjcy_title_ul">
						<li class="number">序号</li>
						<li class="username">用户名</li>
						<li class="tel_num">手机号码</li>
						<li class="operate">操作</li>
					</ul>				
				</div>
				<div id="userrole">
				</div>
			</div>
			<!-- 分页_begin -->
			<div class="page" id="userorlepage">
		    </div>
	    	<!-- 分页_end -->
		<!-- 成员管理_end -->
		<%} %>
		</div>
		<div class="clear"></div>
		<!--main_right end-->
	</div>
	<!--main end-->
	<%@ include file="/user/foot.jsp"%>
</body>
</html>